home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / PASCALL / TEMPJUNK / SCALING.PAS < prev    next >
Pascal/Delphi Source File  |  1992-10-29  |  2KB  |  70 lines

  1. program scaling;
  2. uses
  3.      dos;
  4. type
  5.      imageln:packed array[1..80];
  6.  
  7. procedure openimagefile(var inputfile:text; imagenumber:integer);
  8. begin
  9.      chdir('a:\');
  10.      assign(inputfile,fexpand(concat('image',imagenumber,'.dat'));
  11.      rewrite(inputfile);
  12. end;
  13.  
  14. program scalingprint(imageline:imageln;scale:integer);
  15. var
  16.      i,b,c:=integer;
  17. begin
  18.      for c:=1 to scale do
  19.      begin
  20.           i:=1
  21.           while ord(imageline[i])<>13 do
  22.           begin
  23.                for b:=1 to scale do write(imageline[i]);
  24.                i:=i+1;
  25.           end;
  26.           writeln;
  27.      end;
  28. end;
  29.  
  30. procedure readline(var imageline:imageln; var imagedone:boolean);
  31. var
  32.      i:integer;
  33. begin
  34.      i:=0;
  35.      while not eoln do
  36.      begin
  37.           i:=i+1;
  38.           read(imageline[i]);
  39.      end;
  40.      if i<=1 then imagedone:=true else imagedone:=false;
  41. end;
  42.  
  43. procedure readimage(var outputfile:text; imagenumber:integer);
  44. var
  45.      endofimage:boolean;
  46.      imageline:imageln;
  47. begin
  48.      endofimage:=false;
  49.      openimagefile(outputfile,imagenumber);
  50.      while not endofimage do
  51.      begin
  52.           readline(imageline,endofimage);
  53.           if not endofimage then writeln(outputfile) else close(outputfile);
  54.      end;
  55. end;
  56.  
  57. procedure readinputimagefiles(var outputfile:text; highimagenumber:integer);
  58. var
  59.      imagenumber:integer;
  60. begin
  61.      imagenumber:=1;
  62.      while not eof do
  63.      begin
  64.           readimage(outputfile,imagenumber);
  65.           imagenumber:=imagenumber+1;
  66.      end;
  67.      highimagenumber:=imagenumber-1;
  68. end;
  69.  
  70.